package com.turing.post.common.util;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.turing.post.util.DropdownList;

/**
 * @日志表
 * @author zxp
 * @date 2012-12-14
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "SysOperLog")
public class SysOperLog implements java.io.Serializable {

	/**
	 * 登录类型
	 */
	public static final String operType_Logon = "01";// 01- 登录
	/**
	 * 新增类型
	 */
	public static final String operType_Add = "02";// 02- 新增
	/**
	 * 修改类型
	 */
	public static final String operType_Edit = "03";// 03- 修改
	/**
	 * 删除类型
	 */
	public static final String operType_Delete = "04";// 04- 删除
	/**
	 * 改密类型
	 */
	public static final String operType_ChangePWD = "05";// 05- 改密
	/**
	 * 主键编号
	 */
	private BigInteger logId;
	/**
	 * 操作员号
	 */
	private BigInteger operId;// Int Not Null 互联网登录用户记录为
	/**
	 * 操作类型
	 */
	private String operType;
	/**
	 * 登录IP
	 */
	private String ipAddress;// Varchar(40) Null 登录时赋值
	/**
	 * 发卡商号
	 */
	private String issueCompanyNo;// Varchar（6） Not Null
	/**
	 * 机构号
	 */
	private String branchNo;// Varchar(27) Null
	/**
	 * 商户号
	 */
	private String merchantNo;// Varchar（27） Null
	/**
	 * 操作时间
	 */
	private Date logTime;
	
	private String logName;
	/**
	 * 备注
	 */
	private String remark;// Clob Null

	public SysOperLog() {

	}

	@Id
	@Column(name = "LOGID")
	public BigInteger getLogId() {
		return logId;
	}

	public void setLogId(BigInteger logId) {
		this.logId = logId;
	}

	@Column(name = "OPERID")
	public BigInteger getOperId() {
		return operId;
	}

	public void setOperId(BigInteger operId) {
		this.operId = operId;
	}

	@Column(name = "OPERTYPE")
	public String getOperType() {
		return operType;
	}

	public void setOperType(String operType) {
		this.operType = operType;
	}

	@Column(name = "IPADDRESS")
	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	@Column(name = "ISSUECOMPANYNO")
	public String getIssueCompanyNo() {
		return issueCompanyNo;
	}

	public void setIssueCompanyNo(String issueCompanyNo) {
		this.issueCompanyNo = issueCompanyNo;
	}

	@Column(name = "BRANCHNO")
	public String getBranchNo() {
		return branchNo;
	}

	public void setBranchNo(String branchNo) {
		this.branchNo = branchNo;
	}

	@Column(name = "MERCHANTNO")
	public String getMerchantNo() {
		return merchantNo;
	}

	public void setMerchantNo(String merchantNo) {
		this.merchantNo = merchantNo;
	}

	@Column(name = "LOGTIME")
	public Date getLogTime() {
		return logTime;
	}

	public void setLogTime(Date logTime) {
		this.logTime = logTime;
	}
	
	@Column(name = "LOGNAME")
	public String getLogName() {
		return logName;
	}

	public void setLogName(String logName) {
		this.logName = logName;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * 状态列表信息
	 * 
	 * @param isAll是否包含全部
	 * @return
	 */
	public static List<DropdownList> getSaleOrderOrderStatusList(boolean isAll) {
		List<DropdownList> list = new ArrayList<DropdownList>();
		if (isAll) {
			list.add(new DropdownList("", "全部"));
		}
		list.add(new DropdownList(operType_Logon, "登录"));
		list.add(new DropdownList(operType_Add, "新增"));
		list.add(new DropdownList(operType_Edit, "修改"));
		list.add(new DropdownList(operType_Delete, "删除"));
		list.add(new DropdownList(operType_Delete, "改密"));
		return list;
	}
}